#include <stdio.h>
#include <time.h>
#include "../Customer.h"
#include "CustomerRepository.h"
#include "../support/GenericCache.h"
INCLUDE_MAP(CustomerCache, struct Customer*);
SOURCE_MAP(CustomerCache, struct Customer*);
Map customerCache;
int CustomerRepository_insert(struct Customer* customer)
{
    printf("insert a customer\n");
    CustomerCache_put(&customerCache, customer->id, customer);
    return 0;
}
int CustomerRepository_update(struct Customer* customer)
{
    printf("update a customer\n");
    CustomerCache_put(&customerCache, customer->id, customer);
    return 0;
}
int CustomerRepository_delete(long customerId)
{
    printf("delete a customer\n");
    CustomerCache_remove(&customerCache, customerId);
    return 0;
}
struct Customer* CustomerRepository_get(long customerId)
{
    return CustomerCache_get(&customerCache, customerId);
}